package com.zhipu.balance.pop

import android.widget.Button
import android.widget.TextView
import com.blankj.utilcode.util.ActivityUtils
import com.lxj.xpopup.core.CenterPopupView
import com.zhipu.balance.R
import com.zhipu.balance.listener.ChooseClickCallback

/**
 * 确认弹框
 */
class ConfirmPopup(var mChooseClickCallback : ChooseClickCallback,var mPromptContent : String) : CenterPopupView(ActivityUtils.getTopActivity()){

    override fun getImplLayoutId(): Int {
        return R.layout.popup_confirm
    }

    override fun onCreate() {
        super.onCreate()

        /**
         * 提示内容
         */
        var promptContent = findViewById<TextView>(R.id.promptContent)
        promptContent.text = mPromptContent
        /**
         * 取消
         */
        findViewById<Button>(R.id.Cancel).setOnClickListener {
            dismiss()
        }
        /**
         * 确认
         */
        findViewById<Button>(R.id.Confirm).setOnClickListener {
            mChooseClickCallback.onChooseClickCallback(0)
            dismiss()
        }
    }

}